I'm so glad you like the component. Thank you for saying so.
There is no way to do what you want with configuration options, but those options are slated to be added in future releases.
However, to do what you want regarding choosing one question at random from a possible 20 questions, I came up with an experimental modification to the code that you can try if you're interested.
Once you make the modifications to the code, you will have to set the following Create Single Record module parameters when giving a quiz:
- Fill in one field at a time and submit repeatedly, or fill in a whole record at once? should be set to Whole record at once (multiple fields on form). It should be set this way even though after modifying the code you will only see one randomly selected question given.
- Allow submitted fields to be blank? If set to no, form submission is prevented unless all values are filled in. should be set to Yes
Here are the code modifications. These apply to version
1.1.0 Beta 2 of the Create Single Record module. The file to edit is installed at <joomla_root>/modules/mod_madblanks_createsinglerecord.php
Make a backup copy first!
Insert the following at line 627 (underneath
if ($singleormultifield == 'multi') {):
$choosefromfields = array();
for ($i=1; $i <= $pgFieldCount; $i++) {
$theindex = sprintf('%02d', $i); // sprintf (as opposed to printf) is used to put the value into a variable
if ($configuration["data_" . $theindex . "_use"]) {
$choosefromfields[] = $i;
}
}
$i = $choosefromfields[array_rand($choosefromfields)];
To "comment out" a line in this case means to add // at the beginning of the line.
Comment out line 634, so it looks like this:
// for ($i=0; $i <= $pgFieldCount; $i++) {
Comment out line 752 (just a closing bracket), so it looks like this:
Once the modifications are made, the Score Scripts won't work quite right anymore, but you could still use something like this in your Score Script:
[:answers_correct:0:<start>:]<p>Because you answered ZERO questions correctly, you are seeing this.</p>[:answers_correct:0:<end>:]
[:answers_correct:1:<start>:]<p>Because you answered ONE question correctly, you are seeing this.</p>[:answers_correct:1:<end>:]
If you decide to try this, please let me know how it works.